<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <title>The plasma is an ordinary lieutenant commander.</title>
  </head>
  <body class="">
    <p>Hercle, finis rusticus!, guttus!</p>
    <h1>XMan</h1>
    <form action="/cals" method="POST">
        @csrf
            @php
                $begin=Carbon\Carbon::createFromFormat('Y-m-d', $cals[0]);
                $end=Carbon\Carbon::createFromFormat('Y-m-d', $cals[sizeof($cals)-1]);
                $months=$end->diffInMonths($begin);
                $begin1=Carbon\Carbon::createFromFormat('Y-m-d', $begin->year.'-'.$begin->month.'-1');
                $end1=$begin1->copy();
                $end1->addMonth();
                $end31=(Carbon\Carbon::createFromFormat('Y-m-d', $end->year.'-'.($end->month+1).'-1'))->subDay();
            @endphp
            {{$begin1}}
            @for($i=0; $i<=$months; $i++)
                 <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text text-right" id="">#</span>
                    </div>
                    @for($j=$begin1->copy(); $j<$end1; $j->addDay())
                        <input type="text" class="form-control" maxlength="1" name="days[][]">
                    @endfor
                    @php
                        $begin1->addMonth();
                        $end1->addMonth();
                    @endphp
                </div>
            @endfor

        <button type="submit" class="btn btn-primary">Submit</button>
    </form>
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  </body>
</html>
